import { Controller, Get } from "@nestjs/common";
import { Public } from "src/decorators/is-public.decorator";

import { InjectDefaultService } from "./inject-default.service";
import { InjectTransientService } from "./inject-transient.service";
import { InjectRequestService } from "./inject-request.service";

@Controller('inject-scope')
export class InjectScopeController {
    constructor(
        private readonly injectDefaultService: InjectDefaultService,
        private readonly injectRequestService: InjectRequestService,
        private readonly injectTransientService: InjectTransientService,
    ){}

    @Public()
    @Get('default')
    getDefaultService(): string {
        return this.injectDefaultService.sayHello();
    }

    @Public()
    @Get('request')
    getRequestService(): string {
        return this.injectRequestService.sayHello();
    }
    
    @Public()
    @Get('transient1')
    getTransientService1(): string {
        return this.injectTransientService.sayHello();
    }

    @Public()
    @Get('transient2')
    getTransientService2(): string {
        return this.injectTransientService.sayHello();
    }
}